package org.finesys.chat.core.base.document.splitter;

import org.finesys.chat.core.base.document.tokenizer.Tokenizer;

public class DocumentByCharacterSplitter extends HierarchicalDocumentSplitter {

    public DocumentByCharacterSplitter(int maxSegmentSizeInChars, int maxOverlapSizeInChars) {
        super(maxSegmentSizeInChars, maxOverlapSizeInChars, (Tokenizer) null, (DocumentSplitter) null);
    }

    public DocumentByCharacterSplitter(int maxSegmentSizeInChars, int maxOverlapSizeInChars, DocumentSplitter subSplitter) {
        super(maxSegmentSizeInChars, maxOverlapSizeInChars, (Tokenizer) null, subSplitter);
    }

    public DocumentByCharacterSplitter(int maxSegmentSizeInTokens, int maxOverlapSizeInTokens, Tokenizer tokenizer) {
        super(maxSegmentSizeInTokens, maxOverlapSizeInTokens, tokenizer, (DocumentSplitter) null);
    }

    public DocumentByCharacterSplitter(int maxSegmentSizeInTokens, int maxOverlapSizeInTokens, Tokenizer tokenizer, DocumentSplitter subSplitter) {
        super(maxSegmentSizeInTokens, maxOverlapSizeInTokens, tokenizer, subSplitter);
    }

    /**
     * 将给定的字符串文本拆分成单个字符组成的字符串数组。
     *
     * @param text 要拆分的字符串文本
     * @return 返回一个包含文本中每个字符的字符串数组
     */
    public String[] split(String text) {
        return text.split("");
    }

    public String joinDelimiter() {
        return "";
    }

    protected DocumentSplitter defaultSubSplitter() {
        return null;
    }
}
